package Rekap;

import InterfaceStaff.*;
import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

public class PresensiModelRekap extends AbstractTableModel {

    private List<TabelPresensi> rekap = new ArrayList<TabelPresensi>();

    public PresensiModelRekap(List<TabelPresensi> tp) {
        this.rekap = tp;
    }

    public int getRowCount() {
        return this.rekap.size();
    }

    public int getColumnCount() {
        return 3;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        TabelPresensi k = rekap.get(rowIndex);
        switch (columnIndex) {
            case 0:
                return k.getNimmhs();
            case 1:
                return k.getTotalKehadiran();
            case 2:
                return k.getPersen();
            default:
                return "";
        }
    }

    @Override
    public String getColumnName(int columnIndex) {
        switch (columnIndex) {
            case 0:
                return "NIM";
            case 1:
                return "TotalKehadiran";
            case 2:
                return "Persen";
            default:
                return "";
        }
    }
}
